// 模拟数据服务
export const mockDataAnalysis = {
    // 平台列表
    platforms: [
      { label: '抖音', value: 'douyin', icon: '/icons/douyin.png' },
      { label: '快手', value: 'kuaishou', icon: '/icons/kuaishou.png' },
      { label: '小红书', value: 'xiaohongshu', icon: '/icons/xiaohongshu.png' },
      { label: '微博', value: 'weibo', icon: '/icons/weibo.png' }
    ],
  
    // 标签列表
    tags: [
      { label: '美妆', value: 'beauty' },
      { label: '服装', value: 'clothing' },
      { label: '美食', value: 'food' },
      { label: '旅游', value: 'travel' }
    ],
  
    // 获取概览数据
    getOverviewData() {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve([
            {
              key: 'total_accounts',
              label: '总账号数',
              value: '1,234',
              trend: 5.2,
              icon: 'User',
              color: '#409eff'
            },
            {
              key: 'active_accounts',
              label: '活跃账号',
              value: '865',
              trend: 3.1,
              icon: 'Star',
              color: '#67c23a'
            },
            {
              key: 'total_fans',
              label: '总粉丝数',
              value: '1,532万',
              trend: 8.5,
              icon: 'UserFilled',
              color: '#e6a23c'
            },
            {
              key: 'interaction_rate',
              label: '平均互动率',
              value: '3.2%',
              trend: -1.2,
              icon: 'ChatDotRound',
              color: '#f56c6c'
            }
          ])
        }, 500)
      })
    },
  
    // 获取趋势数据
    getTrendData(metric = 'fans', timeRange = 'week') {
      return new Promise(resolve => {
        setTimeout(() => {
          // 生成7天或30天的数据
          const days = timeRange === 'week' ? 7 : 30
          const data = {
            dates: [],
            values: []
          }
          
          const now = new Date()
          for (let i = 0; i < days; i++) {
            const date = new Date(now - i * 24 * 3600 * 1000)
            data.dates.unshift(date.toISOString().split('T')[0])
            data.values.unshift(Math.floor(Math.random() * 1000))
          }
          
          resolve(data)
        }, 600)
      })
    },
  
    // 获取分布数据
    getDistributionData(type = 'platform') {
      return new Promise(resolve => {
        setTimeout(() => {
          const data = {
            platform: [
              { name: '抖音', value: 235 },
              { name: '快手', value: 189 },
              { name: '小红书', value: 156 },
              { name: '微博', value: 102 }
            ],
            category: [
              { name: '美妆', value: 320 },
              { name: '服装', value: 240 },
              { name: '美食', value: 180 },
              { name: '旅游', value: 150 }
            ],
            tag: [
              { name: '种草', value: 89 },
              { name: '测评', value: 78 },
              { name: '开箱', value: 67 },
              { name: '教程', value: 56 }
            ]
          }
          resolve(data[type])
        }, 400)
      })
    },
  
    // 获取表格数据
    getTableData({ page = 1, pageSize = 20, ...filters } = {}) {
      return new Promise(resolve => {
        setTimeout(() => {
          // 生成模拟数据
          const total = 1234
          const data = Array.from({ length: pageSize }).map((_, index) => ({
            id: (page - 1) * pageSize + index + 1,
            platform: ['douyin', 'kuaishou', 'xiaohongshu', 'weibo'][Math.floor(Math.random() * 4)],
            account: `账号${index + 1}`,
            fans: Math.floor(Math.random() * 1000000),
            posts: Math.floor(Math.random() * 1000),
            interactionRate: (Math.random() * 10 - 5).toFixed(2),
            tags: ['美妆', '服装', '美食', '旅游'].slice(0, Math.floor(Math.random() * 3) + 1),
            updateTime: new Date().toISOString().split('T')[0],
            details: {
              '账号ID': `ID_${Math.random().toString(36).substr(2, 8)}`,
              '注册时间': '2023-01-01',
              '账号等级': 'Lv.3',
              '认证状态': '已认证',
              '所在地区': '北京',
              '简介': '这是一段账号简介...'
            }
          }))
          
          resolve({ data, total })
        }, 800)
      })
    }
  }